#include <cstdio>
#include <map>
#include <set>
#include <string>
#include <vector>
#include <string.h>
using namespace std;

#define foreach( it, a ) for ( __typeof((a).begin()) it = (a).begin(); it != (a).end(); it++ )
#define forn( i, n ) for ( int i=0; i<(int)(n); i++ )

char s[9870], st[9870];
vector<string> all;

int main() {
  freopen( "..\\Data\\training.csv", "r", stdin );

  gets( st );
  while ( gets( s ) )
    all.push_back( s );

  fclose( stdin );

  freopen( "..\\Data\\training1.csv", "w", stdout );
  printf( "%s\n", st );
  forn( i, all.size() )
    if ( i % 10 < 7 ) printf( "%s\n", all[i].c_str() );
  fclose( stdout );

  freopen( "..\\Data\\training2.csv", "w", stdout );
  printf( "%s\n", st );
  forn( i, all.size() )
    if ( i % 10 >= 7 ) printf( "%s\n", all[i].c_str() );
  fclose( stdout );

  return 0;
}